/************************************************
 * Copyright (c) 2007 ~ 2009, 
 * All rights reserved.
 * Version   : 1.0
 * Author    : lengsh@alibaba-inc.com 
 * Date      : 2009.1.2
 ************************************************/

#ifndef   __PANDA_ICACHE_H___
#define   __PANDA_ICACHE_H___

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <signal.h>
#include <unistd.h>
#include <string>
#include <glib.h>

using namespace std;
namespace panda{
class ICache{
public:
	ICache(){}
	virtual ~ICache(){}
	virtual bool Initialize(const char *conf) = 0;
	virtual int Set(const char *data, unsigned dlen) =0 ;//, char **rval, unsigned &rlen) = 0;
	virtual int Get(const char *data, unsigned dlen, char **buf,unsigned &wsize, unsigned &vlen) =0;
	virtual int Incr(const char *data, unsigned dlen, char **buf,unsigned &wsize, unsigned &vlen) =0;
	virtual int Decr(const char *data, unsigned dlen, char **buf,unsigned &wsize, unsigned &vlen) =0;
	virtual int Delete(const char *data, unsigned dlen) = 0; //, char **buf, unsigned &vlen) =0;

        virtual int ResetCacheStatus(const char *ip, int port) = 0;
};

}
#endif  // __PANDA_ICACHE_H___
